package cn.getech.data.development.mapper;

import cn.getech.data.development.entity.ProcJobStatisticsEntity;
import cn.getech.data.development.model.res.procjobstatistics.CompleteStatistics;
import cn.getech.data.development.model.res.procjobstatistics.OfflineDurationTop20Res;
import cn.getech.data.development.model.res.procjobstatistics.ProcJobStatisticsRes;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 项目任务运行统计
 * 
 * @author qiuxinglei
 * @email qiuxinglei@gmail.com
 * @date 2020-09-04 15:45:42
 */
@Mapper
public interface ProcJobStatisticsMapper extends BaseMapper<ProcJobStatisticsEntity> {
    ProcJobStatisticsRes getLast(Map<String,Object> map);

    /**
     * 获取离线任务统计
     * @return
     */
    ProcJobStatisticsRes offlineStatistics(Map<String,Object> map);

    /**
     * 获取本周离线任务成功率
     * @return
     */
    Double offlineWeekRateOfSuccess(Map<String,Object> map);

    ProcJobStatisticsRes offlineRunState(Map<String,Object> map);

    List<CompleteStatistics> offlineDayComplete(Map<String,Object> map);

    List<CompleteStatistics> offlineWeekMonthComplete(Map<String,Object> map);

    List<OfflineDurationTop20Res> offlineDurationTop20(Map<String,Object> map);

    List<CompleteStatistics> realtimeDayComplete(Map<String,Object> map);

    List<CompleteStatistics> realtimeWeekMonthComplete(Map<String,Object> map);

    ProcJobStatisticsRes realtimeStatistics(Map<String,Object> map);

    Integer allTotal(Map<String,Object> map);

    Integer allByState(Map<String,Object> map);

    Integer allNotrun(Map<String,Object> map);
}
